package com.huluobo.a2205monthdemo.parking

import android.content.Intent
import android.graphics.BitmapFactory
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.View
import com.google.vr.sdk.widgets.pano.VrPanoramaView
import com.huluobo.a2205monthdemo.R
import com.huluobo.a2205monthdemo.databinding.ActivityParkingVractivityBinding
import com.huluobo.base.mvvm.BaseActivity
import com.tencent.smtt.utils.p
import dagger.hilt.android.AndroidEntryPoint

@AndroidEntryPoint
class ParkingVRActivity : BaseActivity<ActivityParkingVractivityBinding, ParkingViewModel>() {
    override fun initData() {
    }

    override fun initView() {
        binding.parkingVrHeader.headerTitle.text = "车位预览"
        binding.parkingVrHeader.headerBack.visibility = View.VISIBLE
        binding.parkingVrHeader.headerBack.setOnClickListener { finish() }
        binding.parkingVrHeader.headerAdd.visibility = View.VISIBLE
        binding.parkingVrHeader.headerAdd.setOnClickListener {
            val intent = Intent(this, AddParkingActivity::class.java)
            val parkingBean = getIntent().getSerializableExtra("parkingBean")
            intent.putExtra("parkingBean", parkingBean)
            startActivity(intent)
            finish()
        }

        val option = VrPanoramaView.Options()
        option.inputType = VrPanoramaView.Options.TYPE_MONO
        binding.vrView.loadImageFromBitmap(BitmapFactory.decodeResource(resources, R.drawable.ddd), option)
    }
}